home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / fontconfig-config.config < prev    next >
Text File  |  2008-09-18  |  2KB  |  88 lines

  1. #! /bin/sh
  2.  
  3. set -e
  4.  
  5. . /usr/share/debconf/confmodule
  6.  
  7. CONFDIR=/etc/fonts/conf.d
  8.  
  9. hinting_type="Native"
  10.  
  11. unhinted_2_3="10-debconf-unhinted.conf"
  12. unhinted_2_4="10-unhinted.conf"
  13. autohint_2_3="10-debconf-autohint.conf"
  14. autohint_2_4="10-autohint.conf"
  15.  
  16. if [ -h $CONFDIR/$unhinted_2_4 -o -h $CONFDIR/$unhinted_2_3 ]; then
  17.         hinting_type="None"
  18. fi
  19. if [ -h $CONFDIR/$autohint_2_4 -o -h $CONFDIR/$autohint_2_3 ]; then
  20.         hinting_type="Autohinter"
  21. fi
  22.  
  23. db_set fontconfig/hinting_type "$hinting_type"
  24.  
  25.  
  26. subpixel_rendering="Automatic"
  27.  
  28. subpixel_2_3="20-debconf-sub-pixel.conf"
  29. subpixel_2_4="10-sub-pixel-rgb.conf"
  30. no_subpixel_2_3="20-debconf-no-sub-pixel.conf"
  31. no_subpixel_2_4="10-no-sub-pixel.conf"
  32.  
  33. if [ -h $CONFDIR/$subpixel_2_4 -o -h $CONFDIR/$subpixel_2_3 ]; then
  34.         subpixel_rendering="Always"
  35. fi
  36.  
  37. if [ -h $CONFDIR/$no_subpixel_2_4 -o -h $CONFDIR/$no_subpixel_2_3 ]; then
  38.         subpixel_rendering="Never"
  39. fi
  40.  
  41. db_set fontconfig/subpixel_rendering "$subpixel_rendering"
  42.  
  43.  
  44. # convert old debconf -> new debconf -> current debconf
  45. if [ -f /var/lib/fontconfig/local.conf ]; then
  46.   # old -> current
  47.   if db_get fontconfig/subpixel_rendering; then
  48.     if [ "$RET" = true ]; then
  49.       db_set fontconfig/subpixel_rendering "Always"
  50.       db_set fontconfig/hinting_type "Native"
  51.     fi
  52.   fi
  53.   # new -> current
  54.   if db_get fontconfig/rendering_type; then
  55.     case "$RET" in
  56.     "Subpixel rendering (LCD screens)")
  57.       db_set fontconfig/subpixel_rendering "Always"
  58.       db_set fontconfig/hinting_type "Native"
  59.       ;;
  60.     "Bytecode interpreter (CRT screens)")
  61.       db_set fontconfig/subpixel_rendering "Never"
  62.       db_set fontconfig/hinting_type "Native"
  63.       ;;
  64.     "Autohinter")
  65.       db_set fontconfig/subpixel_rendering "Automatic"
  66.       db_set fontconfig/hinting_type "Autohinter"
  67.       ;;
  68.     esac
  69.     db_unregister fontconfig/rendering_type || true
  70.   fi
  71. fi
  72.  
  73. yes_bitmaps_2_3="30-debconf-yes-bitmaps.conf"
  74. yes_bitmaps_2_4="70-yes-bitmaps.conf"
  75. no_bitmaps_2_3="30-debconf-no-bitmaps.conf"
  76. no_bitmaps_2_4="70-no-bitmaps.conf"
  77.  
  78. if [ -h $CONFDIR/$yes_bitmaps_2_4 -o -h $CONFDIR/$yes_bitmaps_2_3 ]; then
  79.         db_set fontconfig/enable_bitmaps true
  80. elif [ -h $CONFDIR/$no_bitmaps_2_4 -o -h $CONFDIR/$no_bitmaps_2_3 ]; then
  81.         db_set fontconfig/enable_bitmaps false
  82. fi
  83.  
  84. db_input low fontconfig/hinting_type || true
  85. db_input low fontconfig/subpixel_rendering || true
  86. db_input low fontconfig/enable_bitmaps || true
  87. db_go
  88.